#ifndef DYN_CONTROLCHAOS_CONTROLOGY_H
#define DYN_CONTROLCHAOS_CONTROLOGY_H

#include "dyn_controlChaos.h"

/*! \author Joey Dumont <joey.dumont@gmail.com>
 *
 * \date 2012-08-24
 *
 * \brief Uses the original control algorithm by
 * OGY.
 *
 * This class defines the algorithm
 * behind the OGY method to control chaos.
 * We store the unstable contravariant vectors
 * and the parametric change vector
 * in member variables and implement
 * the computeDelta() function.
 */

class ControlOGY : public ControlChaos
{
public:
    /*! The constructor takes all arguments
     * from its root class and the
     * contravariant vectors and parametric
     * variation vectors to computeDelta().
     */
    ControlOGY(MultiMaps* map,
               mat orbitPoints,
               colvec initCond,
               mapsGetPtr getParaPtr,
               mapsSetPtr setParaPta,
               double deltaMax,
               double epsilonNeighborhood,
               int controlIterations,
               int maxIterations,
               mat contravariantVectors,
               mat parametricChange);

    /*! @name Accessor Functions.
     * Access to this class protected variables.
     */
    //@{
    mat getContraVec(){return contraVec;}
    mat getParaVar(){return paraVar;}

    void setContraVec(mat contra){contraVec = contra;}
    void setParaVec(mat para){paraVar = para;}
    //@}

    /*! @name Controlling Chaos algorithm
     * We reimplement the computeDelta() virtual
     * function.
     */
    double computeDelta(int orbitPointIndex, rowvec diff);
protected:
    /*! @name Specialized Variables
     * We declare the information
     * needed by the computeDelta() function.
     */
    //@{
    mat contraVec;
    mat paraVar;
    //@}
};

#endif // DYN_CONTROLCHAOS_CONTROLOGY_H
